#! /bin/bash

# flume采集通道1启动脚本

case $1 in
"start"){
    for i in niit01 niit02
    do
        echo " --------启动 $i 采集flume-------"
        ssh $i "nohup /opt/onlineedu/flume/bin/flume-ng agent --conf-file /opt/onlineedu/flume/job/file-flume-kafka.conf --name a1 -Dflume.root.logger=INFO,LOGFILE >/opt/onlineedu/flume/log1.txt 2>&1  &"
    done
};;
"stop"){
    for i in niit01 niit02
    do
        echo " --------停止 $i 采集flume-------"
        ssh $i "ps -ef | grep file-flume-kafka | grep -v grep |awk  '{print \$2}' | xargs -n1 kill -9 "
    done
};;
esac
